import request from '/@/utils/request';
// 列表
export function RiskModelGetPagedList(params?: object) {
	return request({
		url: '/api/RiskModel/GetPagedList',
		params,
	});
}

// 新增
export function RiskModelCreate(data: any) {
	return request({
		url: 'api/RiskModel/Create',
		method: 'post',
		data,
	});
}
// 编辑
export function RiskModelUpdate(data: any, id: string) {
	return request({
		url: `api/RiskModel/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function BatchDelete(data: any) {
	return request({
		url: 'api/RiskModel/BatchDelete',
		method: 'post',
		data,
	});
}
// 根据Id获取数据
export function RiskModelInfoId(id: string) {
	return request({
		url: `api/RiskModel/Get/${id}`,
	});
}

// 风控字段
// 列表
export function RiskFieldGetPagedList(params?: object) {
	return request({
		url: '/api/RiskField/GetPagedList',
		params,
	});
}

// 新增
export function RiskFieldCreate(data: any) {
	return request({
		url: 'api/RiskField/Create',
		method: 'post',
		data,
	});
}
// 编辑
export function RiskFieldUpdate(data: any, id: string) {
	return request({
		url: `api/RiskField/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function RiskFieldDelete(data: any) {
	return request({
		url: 'api/RiskField/BatchDelete',
		method: 'post',
		data,
	});
}

//  风控预处理
// 列表
export function RiskPreGetPagedList(params?: object) {
	return request({
		url: 'api/RiskPre/GetPagedList',
		params,
	});
}

// 新增
export function RiskPreCreate(data: any) {
	return request({
		url: 'api/RiskPre/Create',
		method: 'post',
		data,
	});
}
// 编辑
export function RiskPreUpdate(data: any, id: string) {
	return request({
		url: `api/RiskPre/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function RiskPreDelete(data: any) {
	return request({
		url: 'api/RiskPre/BatchDelete',
		method: 'post',
		data,
	});
}

//  风控策略
// 列表
export function RiskActivationGetPagedList(params?: object) {
	return request({
		url: 'api/RiskActivation/GetPagedList',
		params,
	});
}

// 新增
export function RiskActivationCreate(data: any) {
	return request({
		url: 'api/RiskActivation/Create',
		method: 'post',
		data,
	});
}

// 复制
export function RiskActivationCopy(data: any, id: string) {
	return request({
		url: `api/RiskActivation/Copy/${id}`,
		method: 'put',
		data,
	});
}
// 编辑
export function RiskActivationUpdate(data: any, id: string) {
	return request({
		url: `api/RiskActivation/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function RiskActivationDelete(data: any) {
	return request({
		url: 'api/RiskActivation/BatchDelete',
		method: 'post',
		data,
	});
}

// 设置风控规则
export function SetRiskActivationStatus(data: any, id: string) {
	return request({
		url: `api/RiskActivation/SetRiskActivationStatus/${id}`,
		method: 'put',
		data,
	});
}

//  风控策略规则
// 列表
export function RiskRuleGetPagedList(params?: object) {
	return request({
		url: 'api/RiskRule/GetPagedList',
		params,
	});
}

// 新增
export function RiskRuleCreate(data: any) {
	return request({
		url: 'api/RiskRule/Create',
		method: 'post',
		data,
	});
}

// 编辑
export function RiskRuleUpdate(data: any, id: string) {
	return request({
		url: `api/RiskRule/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function RiskRuleDelete(data: any) {
	return request({
		url: 'api/RiskRule/BatchDelete',
		method: 'post',
		data,
	});
}

// 设置风控规则
export function RiskRuleSetRiskRuleStatus(data: any, id: string) {
	return request({
		url: `api/RiskRule/SetRiskRuleStatus/${id}`,
		method: 'put',
		data,
	});
}

// 列表
export function RiskAbstractionGetPagedList(params?: object) {
	return request({
		url: 'api/RiskAbstraction/GetPagedList',
		params,
	});
}

// 新增
export function RiskAbstractionCreate(data: any) {
	return request({
		url: 'api/RiskAbstraction/Create',
		method: 'post',
		data,
	});
}

// 编辑
export function RiskAbstractionUpdate(data: any, id: string) {
	return request({
		url: `api/RiskAbstraction/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function RiskAbstractionDelete(data: any) {
	return request({
		url: 'api/RiskAbstraction/BatchDelete',
		method: 'post',
		data,
	});
}

/* RiskApiModel - API应用的风控模型 */

// 列表
export function RiskApiModelGetPagedList(params?: object) {
	return request({
		url: 'api/RiskApiModel/GetPagedList',
		params,
	});
}

// 新增
export function RiskApiModelCreate(data: any) {
	return request({
		url: 'api/RiskApiModel/Create',
		method: 'post',
		data,
	});
}
// 编辑
export function RiskApiModelUpdate(data: any, id: string) {
	return request({
		url: `api/RiskApiModel/Update/${id}`,
		method: 'put',
		data,
	});
}

// 删除
export function RiskApiModelDelete(data: any) {
	return request({
		url: 'api/RiskApiModel/BatchDelete',
		method: 'post',
		data,
	});
}

// 根据Id获取数据
export function RiskApiModelId(id: string) {
	return request({
		url: `/api/GrantSubSystemInfo/GetGrantInterfaceBySubSystemId/${id}`,
	});
}

/* RiskApiModel - API应用的风控模型 */

// 构建风控模型
export function ConstructModel(data: any) {
	return request({
		url: 'api/RiskModel/ConstructModel',
		method: 'post',
		data,
	});
}
